<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     * 厂家商品,客户商品表
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id')->comment('所属厂家');
            $table->string('goods_name')->comment('商品名称');
            $table->string('goods_img')->nullable()->comment('商品图片');
            $table->decimal('price', 10 , 2)->comment('商品价格');
            $table->string('goods_code')->unique()->comment('商品CODE');
            $table->string('is_show')->default(1)->comment('是否售卖(0不售卖,1售卖)');
            $table->softDeletes()->comment('软删除');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
}
